package org.icop.frame.search;


import java.util.Collection;

import org.icop.model.MultiSet;
import org.icop.model.ValuedCorrespondence;
import org.jbpt.graph.abs.IEdge;
import org.jbpt.graph.abs.IGraph;
import org.jbpt.hypergraph.abs.IVertex;

public interface Searcher<G extends IGraph<E,V>, E extends IEdge<V>, V extends IVertex> {
	
	/**
	 * Returns a set that consists of viable matches. Each viable match has a score 
	 * (0 <= score <= 1) that indicates the quality of the match (higher is better).
	 * 
	 * For each viable match: (s1,s2) \subseteq sg1.getVertices() \times sg2.getVertices().
	 * Note that the set of viable matches does not have to match all vertices from the graphs; 
	 * vertices that are not matches will be matched by another searcher. (A 'wrap-up' searcher
	 * is defined to determine the viable matches for vertices that are not matched by any
	 * other searcher.)
	 * 
	 * @param sg1 First graph to determine viable matches for
	 * @param sg2 Second graph to determine viable matches for.
	 * @param nodesInSg1 Nodes of the first graph that should be considered for matching
	 * @param nodesInSg2 Nodes of the second graph that should be considered for matching
	 * @return A set of viable matches.
	 */
	public MultiSet<ValuedCorrespondence<V>> search(G sg1, G sg2, Collection<V> nodesInSg1, Collection<V> nodesInSg2, MultiSet<ValuedCorrespondence<V>> matches);
}
